#ifndef SRC_CORE_ASYNC_LISTENER_H_
#define SRC_CORE_ASYNC_LISTENER_H_

#include "core/async_packet_socket.h"

#define DEFAULT_LISTEN_BACKLOG 5

namespace vz {

class AsyncListener : public RefCountInterface,
  public sigslot::has_slots<> {
 public:
  typedef scoped_refptr<AsyncListener> Ptr;

  sigslot::signal2<AsyncListener::Ptr,
          AsyncPacketSocket::Ptr> SignalAcceptEvent;
  sigslot::signal2<AsyncListener::Ptr,
          int> SignalCloseEvent;

  virtual bool Start(SocketAddress &address,
                     int listen_backlog = DEFAULT_LISTEN_BACKLOG) = 0;
};

}  // namespace vz

#endif  // SRC_CORE_ASYNC_LISTENER_H_



